package com.pactera.vo.sys;

import java.io.Serializable;
import java.util.List;

/**
 * 自定义Authentication对象，使得Subject除了携带用户的登录名外还可以携带更多信息
 */
public class ShiroUser implements Serializable {

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	private static final long serialVersionUID = -1373760761780840081L;
	public String id;
	public String loginName;
	public String name;
	public List<String> roleList;

	public ShiroUser(String id, String loginName, String name, List<String> roleList) {
		this.id = id;
		this.loginName = loginName;
		this.name = name;
		this.roleList = roleList;
	}

	public String getName() {
		return name;
	}

	public String getId() {
		return id;
	}

	public String getLoginName() {
		return loginName;
	}

	public List<String> getRoleList() {
		return roleList;
	}

	/**
	 * 本函数输出将作为默认的<shiro:principal/>输出.
	 */
	@Override
	public String toString() {
		return loginName;
	}
}